{% extends "base_detail.html" %}

{% load i18n %}
{% load breadcrumbs %}
{% load region %}
{% load menu %}
{% load details %}

{% block breadcrumbs %}
    {% add_crumb 'Home' '/' %}
    {% add_crumb 'Products' 'product_list' %}
    {% add_crumb object %}
{% endblock %}

{% block objectactions %}
{% if perms.products.add_product %}
<li class="add"><a title="{% trans 'Add' %}" href="{% url product_add %}">{% trans 'Add' %}</a></li>
{% endif %}
{% if object.pk in obj_perms.products.change_product %}
<li class="edit"><a title="{% trans 'Edit' %}" href="{% url product_edit object.pk %}">{% trans 'Edit' %}</a></li>
{% endif %}
{% if object.pk in obj_perms.products.delete_product %}
<li class="delete"><a title="{% trans 'Delete' %}" href="{% url product_delete object.pk %}">{% trans 'Delete' %}</a></li>
{% endif %}
{% if perms.products.view_product %}
<li class="all"><a title="{% trans 'All' %}" href="{% url product_list %}">{% trans 'All' %}</a></li>
{% endif %}
{% if object.pk in obj_perms.products.view_product %}
{% if user not in object.stream.followers.all %}
<li class="follow"><a title="{% trans 'Follow' %}" href="{% url stream_follow object.stream request.path %}">{% trans 'Follow' %}</a></li>
{% else %}
<li class="leave"><a title="{% trans 'Leave' %}" href="{% url stream_leave object.stream request.path %}">{% trans 'Leave' %}</a></li>
{% endif %}
{% endif %}
{% endblock %}

{% block objectmenu %}{% menu "product_menu" %}{% endblock %}

{% block section %}
<div class="details">
    <table class="properties">
        {% property_table object "['ean13', ['uom', 'uos'], ['uom_to_uos', 'weight'], ['is_consumable', 'is_service'], ['sales_price', 'sales_currency'], ['max_sales_discount', 'sales_tax'], 'description', 'categories', 'tags']" %}
    </table>
</div>
{% with dashboard=object.dashboard %}
{% include "elements/dashboard.html" %}
{% endwith %}
{% include "elements/comments.html" %}
{% endblock %}
